{% extends "base.html" %}

{% block content %}
<div id="topic">
<h3>Discussion post</h3>
<!-- TinyMCE -->
<script type="text/javascript" src="scripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
	tinyMCE.init({
		mode : "specific_textareas",
        editor_selector : "mceEditor",
		theme : "advanced"
	});
</script>
<!-- /TinyMCE -->
<div id="entryform">
<div id="original-post">
    <span class="original-post-title">
        {% if discussion %}For discussion: {{ discussion.title }}{% endif %}
        {% if article %}For article: {{ article.title }}{% endif %}
        {% if document %}For document: {{ document.title }}{% endif %}
    </span>
    <div class="comment-message">
        {% if discussion %}{{ discussion.description }}{% endif %}
        {% if article %}{{ article.summary }}{% endif %}
        {% if document %}{{ document.summary }}{% endif %}
    </div>
</div>

<br/><p></p>
          <form id="posttopic" action="/posttopic" method="post" onsubmit="return validate_posttopic(this)">
            <label>Title:</label>
            <input class="textbox" name="title" maxlength="200"><br/>
            <label>Message:</label>
            <textarea name="message" rows="8" class="mceEditor"></textarea><br/>
            <label></label><input type="submit" name="action" value="Save Post"><br/>
            {% if discussion %}<input type="hidden" name="discussionkey" value="{{ discussion.key }}">{% endif %}
            {% if article %}<input type="hidden" name="articlekey" value="{{ article.key }}">{% endif %}
            {% if document %}<input type="hidden" name="documentkey" value="{{ document.key }}">{% endif %}
          </form>
</div>
</div>
{% endblock %}